package com.example.sprintboot.controller;

import com.example.sprintboot.entity.Category;
import com.example.sprintboot.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/api/categories")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping
    public List<Category> getCategoryTree() {
        return categoryService.getCategoryTree();
    }
} 